#include "keyframe.h"

namespace sad {

unsigned int KeyFrame::next_id_ = 0;

KeyFrame::KeyFrame(const std::shared_ptr<NavStated> this_frame, const std::shared_ptr<IMUPreintegration> pre_integ, const GNSS& this_gnss) {
    id_ = next_id_++;
    this_frame_ = this_frame;
    pre_integ_ = pre_integ;

    this_gnss_ = this_gnss;
}

KeyFrame::~KeyFrame() {

}

void KeyFrame::SetImuState(const std::shared_ptr<NavStated>& imu_state) {
	this_frame_ = imu_state;
}

void KeyFrame::SetImuBias(const Eigen::Vector3d &bg, const Eigen::Vector3d &ba) {
    pre_integ_->SetImuBias(bg, ba);
}

}  // namespace sad